﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="MicroReport.aspx.cs" Inherits="ExamAnalysis.Reports.MicroReport" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <script type="text/javascript">
        var percent = function (value) {
            return value + "%";
        };

        var submitValue = function (grid, hiddenFormat, format) {
            hiddenFormat.setValue(format);
            grid.submitData(false, { isUpload: true });
        };
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="TitleContent" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="MainContent" runat="server">
    <ext:Hidden ID="FormatType" runat="server" />
    <ext:GridPanel 
        ID="GridPanel"
        runat="server" 
        Title="超级管理员小分整体通用分析报表" 
        ColumnLines="true"
        Height="450">
        <Store>
            <ext:Store ID="GridStore" runat="server" OnSubmitData="Store_Submit">
                <Model>
                    <ext:Model runat="server">
                        <Fields>
                            <ext:ModelField Name="ExamItemID" Type="Int" />
                            <ext:ModelField Name="ItemScore" Type="Int" />
                            <ext:ModelField Name="ItemName" Type="String" />
                            <ext:ModelField Name="DifficultyLevel" Type="Int" />
                            <ext:ModelField Name="DiffenceDegree" Type="Float" />
                            <ext:ModelField Name="KnowledgePointID" Type="Int" />
                            <ext:ModelField Name="KnowledgePointName" Type="String" />
                            <ext:ModelField Name="KnowledgePointScoreRate" Type="Float" />
                            <ext:ModelField Name="ScoreRate" Type="Float" />
                            <ext:ModelField Name="WrongCount" Type="Int" />
                            <ext:ModelField Name="CorrectCount" Type="Int" />
                            <ext:ModelField Name="AnswerCount" Type="Int" />
                            <ext:ModelField Name="Reason1" Type="Int" />
                            <ext:ModelField Name="Reason2" Type="Int" />
                            <ext:ModelField Name="Reason3" Type="Int" />
                            <ext:ModelField Name="Reason4" Type="Int" />
                            <ext:ModelField Name="ReasonPercent1" Type="Float" />
                            <ext:ModelField Name="ReasonPercent2" Type="Float" />
                            <ext:ModelField Name="ReasonPercent3" Type="Float" />
                            <ext:ModelField Name="ReasonPercent4" Type="Float" />
                            <ext:ModelField Name="ChooseA" Type="Int" />
                            <ext:ModelField Name="ChooseB" Type="Int" />
                            <ext:ModelField Name="ChooseC" Type="Int" />
                            <ext:ModelField Name="ChooseD" Type="Int" />
                            <ext:ModelField Name="ChoosePercentA" Type="Float" />
                            <ext:ModelField Name="ChoosePercentB" Type="Float" />
                            <ext:ModelField Name="ChoosePercentC" Type="Float" />
                            <ext:ModelField Name="ChoosePercentD" Type="Float" />
                        </Fields>
                    </ext:Model>
                </Model>
            </ext:Store>
        </Store>
        <TopBar>
            <ext:Toolbar runat="server">
                <Items>
                    <ext:Label runat="server" Text="选择学期：" />
                     <ext:ComboBox 
                        ID="CalendarList" 
                        Width="200" 
                        runat="server"
                        DisplayField="DisplayName" 
                        ValueField="CalendarID">
                        <Store>
                            <ext:Store runat="server" ID="CalendarStore">
                                <Model>
                                    <ext:Model runat="server" IDProperty="CalendarID">
                                        <Fields>
                                            <ext:ModelField Name="DisplayName" />
                                            <ext:ModelField Name="CalendarID" />
                                        </Fields>
                                    </ext:Model>
                                </Model>
                            </ext:Store>
                        </Store>
                        <DirectEvents>
                            <Select OnEvent="CanlendarList_SelectedItemChanged" />
                        </DirectEvents>
                    </ext:ComboBox>
                    <ext:Label runat="server" Text="选择考试：" />
                    <ext:ComboBox 
                        ID="ExamList" 
                        Width="300" 
                        runat="server"
                        DisplayField="ExamName" 
                        ValueField="ExamID">
                        <Store>
                            <ext:Store runat="server" ID="ExamStore">
                                <Model>
                                    <ext:Model runat="server" IDProperty="ExamID">
                                        <Fields>
                                            <ext:ModelField Name="ExamName" />
                                            <ext:ModelField Name="ExamID" />
                                        </Fields>
                                    </ext:Model>
                                </Model>
                            </ext:Store>
                        </Store>
                    </ext:ComboBox>
                    <ext:Button Text="生成" Icon="Accept" runat="server">
                        <DirectEvents>
                            <Click OnEvent="SubmitButton_Click" Timeout="60000"  />
                        </DirectEvents>
                    </ext:Button>
                    <ext:Button Text="保存" AutoPostBack="true" Icon="Disk" runat="server">
                        <Listeners>
                            <Click Handler="submitValue(#{GridPanel}, #{FormatType}, 'xls');" />
                        </Listeners>
                    </ext:Button>
                    <ext:Button Text="打印" Icon="Printer" runat="server">
                        <Listeners>
                            <Click Handler="javascript:window.print();" />
                        </Listeners>
                    </ext:Button>
                </Items>
            </ext:Toolbar>
        </TopBar>
        <ColumnModel runat="server">
            <Columns>
                <ext:Column runat="server" Text="编号" Width="40" DataIndex="ExamItemID" Sortable="true" />
                <ext:Column runat="server" Text="描述" Width="300" DataIndex="ItemName" Sortable="true" />
                <ext:Column runat="server" Text="分值" Width="40" DataIndex="ItemScore" Sortable="true" />
                <ext:Column runat="server" Text="答题情况" Sortable="true">
                    <Columns>
                        <ext:Column runat="server" Text="人数" Width="40" DataIndex="AnswerCount" Sortable="true" />
                        <ext:Column runat="server" Text="得分率" DataIndex="ScoreRate" Sortable="true">
                            <Renderer Fn="percent" />
                        </ext:Column>
                    </Columns>
                </ext:Column>
                <ext:Column runat="server" Text="错因比例" Sortable="true">
                    <Columns>           
                        <ext:Column Text="1.回答正确" runat="server" DataIndex="ReasonPercent1" Sortable="true">
                            <Renderer Fn="percent" />
                        </ext:Column>
                        <ext:Column Text="2.不会做" DataIndex="ReasonPercent2" Sortable="true">
                            <Renderer Fn="percent" />
                        </ext:Column>
                        <ext:Column Text="3.粗心大意" DataIndex="ReasonPercent3" Sortable="true">
                            <Renderer Fn="percent" />
                        </ext:Column>
                        <ext:Column Text="4.其他" DataIndex="ReasonPercent4" Sortable="true">
                            <Renderer Fn="percent" />
                        </ext:Column>
                    </Columns>
                </ext:Column>
                <ext:Column runat="server" Text="命题相关" Sortable="true">
                    <Columns>
                        <ext:Column Text="小题难度" DataIndex="DifficultyLevel" Sortable="true" />
                        <ext:Column Text="区分度" DataIndex="DiffenceDegree" Sortable="true">
                            <Renderer Fn="percent" Format="Number" FormatArgs="0.00" />
                        </ext:Column>
                    </Columns>
                </ext:Column>
                <ext:Column runat="server" Text="教学内容掌握情况" Sortable="true">
                    <Columns>
                        <ext:Column Text="知识点" DataIndex="KnowledgePointName" Sortable="true" />
                        <ext:Column Text="错误率" DataIndex="KnowledgePointScoreRate" Sortable="true">
                            <Renderer Fn="percent" />
                        </ext:Column>
                    </Columns>
                </ext:Column>
                <ext:Column runat="server" Text="客观题" Sortable="true">
                    <Columns>           
                        <ext:Column Text="选项A" runat="server" DataIndex="ChoosePercentA" Sortable="true">
                            <Renderer Fn="percent" />
                        </ext:Column>
                        <ext:Column Text="选项B" DataIndex="ChoosePercentB" Sortable="true">
                            <Renderer Fn="percent" />
                        </ext:Column>
                        <ext:Column Text="选项C" DataIndex="ChoosePercentC" Sortable="true">
                            <Renderer Fn="percent" />
                        </ext:Column>
                        <ext:Column Text="选项D" DataIndex="ChoosePercentD" Sortable="true">
                            <Renderer Fn="percent" />
                        </ext:Column>
                    </Columns>
                </ext:Column>
            </Columns>
        </ColumnModel>
    </ext:GridPanel>
</asp:Content>

